package user;

import book.BookList;
import operation.IOperation;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2023-11-15
 * Time: 22:48
 */
public abstract class User {
    protected String name;
    protected IOperation[] iOperations; //没有初始化,没有分配空间

    public User(String name) {
        this.name = name;
    }
    public abstract int menu();
    public void doOperation(int choice, BookList bookList){
        this.iOperations[choice].work(bookList);
        /*IOperation iOperation = this.iOperations[choice];  第二种写法
        iOperation.work(bookList);*/
    }
}
